{extend name="default/base" /}
{block name="main"}
  <div class='wst-grid' style='margin-top:10px;'> 
    <table class='wst-form'>
      <tr>
        <td style="padding-right:5px;">店铺公告：</td>
      </tr>
      <tr>
        <td>
          <textarea style="width:100%;height:200px;resize:none;padding:10px;" placeholder='请保持在150个字以内' class="ipt" id="shopNotice" maxlength='150'>{$notice}</textarea>
      </td>
      </tr>
    </table>
    <button onclick="toEdits()" class="btn btn-primary" style="margin-left: 45%;padding: 5px 10px;margin-top: 20px;"><i class="fa fa-check"></i>保&nbsp;存</button>
  </div>
{/block}
{block name="js"}

<script>
function toEdits(id){
  var params = WST.getParams('.ipt');
  console.log(params.shopNotice.length);
  if(params.shopNotice.length>150){
    WST.msg('店铺公告不能超过150个字',{icon:2});
    return;
  }
  var loading = WST.msg('正在提交数据，请稍后...', {icon: 16,time:60000});
  $.post(WST.U('shop/shops/editNotice'),params,function(data,textStatus){
      layer.close(loading);
      var json = WST.toJson(data);
      if(json.status=='1'){
          WST.msg(json.msg,{icon:1});
      }else{
            WST.msg(json.msg,{icon:2});
      }
  });
}
</script>


{/block}
